// API配置文件
const API_BASE_URL = '/stock';

export default {
  BASE_URL: API_BASE_URL,
  AUTH: {
    REGISTER: `${API_BASE_URL}/api/auth/register`,
    LOGIN: `${API_BASE_URL}/api/auth/login`
  },
  STOCKS: {
    GET_ALL: `${API_BASE_URL}/api/stocks`,
    GET_BY_SYMBOL: (symbol) => `${API_BASE_URL}/api/stocks/${symbol}`,
    GET_REAL: (symbol) => `${API_BASE_URL}/api/stocks/real/${symbol}`,
    GET_REAL_MULTIPLE: `${API_BASE_URL}/api/stocks/real/multiple`,
    UPDATE_PRICE: (symbol) => `${API_BASE_URL}/api/stocks/${symbol}/price`,
    SIMULATE: `${API_BASE_URL}/api/stocks/simulate`
  },
  TRADES: {
    CREATE: `${API_BASE_URL}/api/trades`,
    EXECUTE: (tradeId) => `${API_BASE_URL}/api/trades/${tradeId}/execute`,
    CANCEL: (tradeId) => `${API_BASE_URL}/api/trades/${tradeId}/cancel`,
    GET_BY_ID: (tradeId) => `${API_BASE_URL}/api/trades/${tradeId}`,
    GET_ALL: `${API_BASE_URL}/api/trades`,
    GET_BY_SYMBOL: (symbol) => `${API_BASE_URL}/api/trades/symbol/${symbol}`
  },
  USERS: {
    CREATE: `${API_BASE_URL}/api/users`,
    GET_BY_ID: (userId) => `${API_BASE_URL}/api/users/${userId}`,
    GET_ALL: `${API_BASE_URL}/api/users`,
    BUY_STOCK: (userId) => `${API_BASE_URL}/api/users/${userId}/buy`,
    SELL_STOCK: (userId) => `${API_BASE_URL}/api/users/${userId}/sell`,
    GET_PORTFOLIO: (userId) => `${API_BASE_URL}/api/users/${userId}/portfolio`
  },
  STRATEGIES: {
    CREATE: `${API_BASE_URL}/api/strategies`,
    GET_ALL: `${API_BASE_URL}/api/strategies`,
    GET_BY_ID: (id) => `${API_BASE_URL}/api/strategies/${id}`,
    UPDATE: (id) => `${API_BASE_URL}/api/strategies/${id}`,
    DELETE: (id) => `${API_BASE_URL}/api/strategies/${id}`,
    EXECUTE_MA: `${API_BASE_URL}/api/strategies/execute/ma`,
    EXECUTE_RSI: `${API_BASE_URL}/api/strategies/execute/rsi`,
    EXECUTE_BB: `${API_BASE_URL}/api/strategies/execute/bb`,
    EXECUTE_TURTLE: `${API_BASE_URL}/api/strategies/execute/turtle`,
    EXECUTE_MULTI_FACTOR: `${API_BASE_URL}/api/strategies/execute/multi-factor`
  }
};